<div id="content-left">
	{{if false == $user}}
	
	<script type="text/javascript" src="{{$LAYOUT_HELPER_URL}}front/js/jquery.validate.js" ></script>
	<script type="text/javascript">
		jQuery(document).ready(function(){
			// validate signup form on keyup and submit
		    jQuery("#form_login").validate({
		        rules: {
		            'username': "required",
		            'password': {
		                required: true,
		                minlength: 6
		            }
		        },
		        messages: {
		            'username': "",
		            'password': "",
		        }
		    });
		});
	
		function submitForm() {
			jQuery("#form_login").submit();
		}

		$(function(){
			  $('#form_login input').keydown(function(e){
			      if (e.keyCode == 13) {
			  		//parent.$.fancybox.close();
			      	$("#form_login").submit();
			      }
			  });
		});
		
	</script>
	
	<div class="box" id="login">
		<h4 class="title">Đăng nhập tài khoản ví điện tử</h4>
		
		<form id="form_login" name="form_login" method="post" action="{{$APP_BASE_URL}}access/index/login" style="margin:0px; padding:0px;">
			<div id="input-login">
				<div class="message-box"></div>
		        <table border="0" cellspacing="0" width="100%">
		        	<tr>
		            	<td style="padding-bottom:10px;">Tài khoản:</td>
		                <td align="left"><input name="username" type="text" value="" id="username" style="color:#777;width:130px; margin:0px; padding:0px;height:18px;font-size:12px;border:1px solid #a5b4bc;" /></td>
		            </tr>
		            <tr>
		            	<td>Mật khẩu:</td>
		                <td align="left"><input name="password" type="password" id="password" value="" style="color:#777;width:130px; margin:0px; padding:0px;height:18px;font-size:12px; border:1px solid #a5b4bc;"/></td>
		            </tr>
		            
		        </table>
		    </div>
			<div id="box-button-login" style="margin-top:6px;">
				<input name="cmdLogin" type="button" id="submitBtn" value="Đăng nhập" class="button-content" onclick="javascript:submitForm();"  />
				<a href="">Quên mật khẩu?</a>
			</div>
		</form>
		
		<div id="dangky">
			Bạn chưa có ví điện tử BKPay.Vn?<br />
	        <a href="{{$registerUrl}}"><img src="{{$LAYOUT_HELPER_URL}}front/images/button-registration-index.png" border="0" /></a>
		</div>
	</div>
	{{else}}
	
	<script type="text/javascript">
		function submitForm(){
			jQuery("#form_logout").submit();
		}
	
	</script>
	
	
		<div id="login" class="box">
			<h4 class="title">Bạn đã đăng nhập</h4>
			<form id="form_logout" name="form_logout" action="{{$APP_BASE_URL}}access/index/logout" method="post" >
				<div id="account-login">
					<div id="accout-login-name">
						<p>Tài khoản: <font class="yel">{{$user.email}}</font></p>
					</div>
				</div>
				<div id="operation-login">
					<ul>
						<li><a href="{{$profileUrl}}">Xem tài khoản</a></li>
						<li><a href="{{$managerUrl}}">Lịch sử giao dịch</a></li>
						<li><a href="{{$APP_BASE_URL}}user/index/view-wallet">Thông tin ví tiền</a></li>
					</ul>
				</div>
				<div style="border-bottom:1px solid #fff;" id="box-button-login">
					<input type="button" value="Đăng xuất" class="button-content" name="cmdLogout" onclick="javascript:submitForm();" >
				</div>
			</form>
		</div>
	{{/if}}
	
	<div class="box" id="help-index-left">
	    <h4 class="title">Tin mới cập nhật</h4>
	    <ul>
			{{foreach from=$allNews item=item}}
			<li><a href="#" class="{act}" target="_blank" title="{{$item.title}}">{{$item.title}}</a></li>
			{{/foreach}}
	    </ul>
		<p class="redmove"> <a href="" target="_blank">Xem thêm</a></p>
	</div>
</div>